<?php

##############config bot################

$bot['like']        = true; // false untuk non aktifkan autolike

 

$bot['ck_k']        = true; // false untuk non aktifkan fungsi jika status mengandung kata maka di comen dengan kata

$bot['ck_u']        = true; // true jika pengkondisian di non aktifkan akan beralih ke koment umum jika kondisi aktif komen umum juga aktif (tidak akan dobel komen jika keduanya aktif)

$bot['time']        = true; // false untuk menonaktifkan fungsi waktu di komentar

$app['aces']        = "AAAA********"; // access_token wajib di isi dengan permision token (read_stream,publish_stream,offline_access)

##############config bot################

$caspercell="

 

 

 

##############By Me####################

#    BOT Facebook v 1.4cr 3/feb/2011 modified 20/agu/2012 #    

#######################################

 

 

";

##############config msg################

$msg['com_no1']  = array("lha yang perdana commentku xixixixi...!!!   ","No 1 Lagi dech Nancy xixixi.  ","yang tercepat komen kan.?  ","masih yang terdepan buwat komen.  hihihihi ");

$msg['com_no_']  = array("meski no <n> yg penting setia.  ","sory gak no 1 lagi.  jempolku lagi kesleo tp jadi yang no <n> gppya.  "," walah nancy kalah cepet dah. gk no 1 lagi.  ");

$msg['com_umum'] = array("<no> \n hadir menyukai  status <sex> <name> !!!",

                  "Mampir di statusmu boleh kan <sex> .? \n <smile> hihihihi.\n<no>",

                  "maaf yah \n <no> klo commentku ga berkenan di hati <sex> <name>.. <smile> :D",

                  "hehe lagi ga ada kerjaan nuihh, jadi bisa koment di statusmu <sex> <name> :D",

                  "<no>\ncuma mo bilang.!\n Orang cakep lewat distatusmu <sex> minggirrrrrrrr.. :P <smile> ",

                  "Bingung mo koment apa <sex> :D <smile> ",

                  "Nulis status gak perlu mikir yang penting asyik. stuju kan <sex> <name>..?",

                  "absen koment aja deh <sex>. <smile> hihihii\n<no>",

                  "Ampek jempol kriting tetep stia nancy coment di statusmu <sex> <name> <smile> :D",

                  "Numpang ngisi koment distatusmu <sex> <name>..:D\n<no>",

                  "ga kan ngecewain deh, like this dan komen hadir selalu untukmu <sex> <name>",

                  "<sex> <name>... statusmu sip banget.! <smile>  pokoknya JEMPOL trus dah..:D\n<no>",

                  "apapun statusnya? jempol nancy slalu mampir di statusmu <sex>\n<no>",

                  "status <sex> <name> emang tempat nongkrong komentarku. <smile> hihi",

                  "mau komen apa ya?? bingung?? nambah like this, biar tambah eksis aja <sex>. <smile> hihihihihi.... :D",

                  "Di tungguin dari tadi,, akhirnya <sex> <name> update status juga, <smile>  oklah tanpa basa-basi lagi nancy kasi jempol dah,, Like This ya <sex> <smile> ",

                  "<no>\ndikasih tempat komen ama <sex> <name>. gak mungkin gak koment nancy.. <smile> ",

                  "lupa <sex>? \n<no>. hadoh nancy kok bisa lupa to!! hihihi",

                  "Pokoknya nancy jadi penggemar setia postinganmu <sex>. Jadi slalu setia hadir. <smile> \n<no>",

                  "walah <sex> <name> update status. nancy slalu setia dateng n koment ya <sex>. <smile> hihi\n<no>",

                  );

 

$msg['com_photo'] = array("<no> \n wow kerennnn picnya <sex> <name> <smile>",

                         "udah nancy like. <smile>\n<no> potonya sip <sex>",

                         "<smile> waw siapa itu <sex> <name>.?",

                         "<name> maaf kgk kelihat,soalnya pake hp tanpa layar. gomen <sex>\n<no>",

                  );

$msg['com_kondisi'] = array(

                            array(

                                array(  "galau",

                                        "galaw",

                                    ),

                                array(  "<sex> <name> lagi galau kasihan..  ",

                                        "nancy juga lagi galau <sex> <name>. sama",

                                    )

                                ),

                            array(

                                array(  "sepi",

                                        "pada kemana",

                                        "pada kmn",

                                    ),

                                array(  "Nih Udah nancy ramein <sex>.  hhe",

                                        "Meski sepi JEMPOL nancy masih setia di status <sex> <name>.  hhe",

                                        "He'eh ni penghuni FB pada tidur kali. tapi JEMPOL nancy slalu hadir buat statusmu kan <sex>?",

                                    )

                                ),

                            array(

                                array(  "semoga",

                                        "moga",

                                        "amin",

                                    ),

                                array(  "Amin <sex> <name>.. Skalian like this juga ah. biar tambah exsis.  hhe",

                                        "Mang knape <sex> <name>.?",

                                        "He'eh ni penghuni FB pada tidur kali. tapi JEMPOL nancy slalu hadir buat statusmu <sex> <name>",

                                    )

                                ),

                            array(

                                array(  "jancok",

                                        " asu ",

                                        " raimu ",

                                        " matamu ",

                                        " bangsat ",

                                    ),

                                array(  "Wew. <sex> <name> lagi marah. :) tetep nancy kasih LIKE THIS dah.  hhe",

                                        "ada apa <sex>? kok marah amat..?  wkwkwkwk",

                                        "nancy hadir buat ademin hati kamu <sex> <name>.  wkwkwkwk",

                                        "Meski km marah <sex>.nancy tetep hadir aja dah n like this.  :D",

                                    )

                                ),

                            array(

                                array(  "lapar",

                                        " ewul ",

                                        " luwe ",

                                        "laper",

                                        " krucuk",

                                    ),

                                array(  "Ni makanan buanyak disini. mau a <sex>..?  hhe",

                                        "sama <sex> <name> klaparan nih. nyindir.com.  wkwkwkwk",

                                    )

                                ),

                            array(

                                array(  "askum",

                                        "asalam",

                                        "assalam",

                                        "mekum",

                                        "laikum",

                                    ),

                                array(  "Waalaikumsalam warahmatullahi wabarakatuh. <sex> <name>  hihi",

                                        "Waskum <sex>..",

                                    )

                                ),

                            array(

                                array(  "pamid",

                                        "off dulu",

                                        "ngantuk",

                                        "bobok",

                                        "tidur",

                                    ),

                                array(  "lho aq ditinggal <sex> <name>  wkwkwkwk",

                                        "wew. masih jam sgini <sex> mo kmana.?",

                                        "Walah mau kmana <sex>..?",

                                        "Lho <sex>. weh Ditinggal dah nancy.  hhe.",

                                    )

                                ),

                            );

$casperbot=new cr_bot;

error_reporting(5);

@ignore_user_abort(TRUE);

@set_magic_quotes_runtime(0);

@ini_set("max_execution_time",0);

$msg['me'] = json_decode($casperbot->http_hit("https://graph.facebook.com/me?access_token=".$app['aces']));

$hit=0;

$stat=array(1,2);

$stat=$stat[rand(0,count($stat) - 1)];

if(strlen($caspercell)==482 && ereg("a"."lk"."a"."af"."i",$caspercell)){$okebot=true;}

while($okebot==true){

    $msg['type'] = "home";

    if($stat==1){

        $stat=2;

        $tes=($casperbot->get_cr($msg,$bot,$app));

    }elseif($stat==2){

        $stat=1;

        $wwwo=$casperbot->notif_respon($msg,$bot,$app);

    }

    $hit = $hit+1;

    if($hit>=5){

        $wwwo=file_get_contents("http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);

        break;

    }

}

class cr_bot{

    function notif_respon($msg,$bot,$app){

    }

    function acak_komen($msg,$bot){

        $kommen  = '';

        if($bot['ck_k']==true){

            foreach($msg['com_kondisi'] as $kom){

                foreach($kom[0] as $cx){

                    if(ereg($cx,$msg['message'])){ $kommen = $kom[1][rand(0,count($kom[1]) - 1)]; }

                }

            }

        }

        if($kommen=='' && $bot['ck_u']==true){ $kommen = $msg['com_umum'][rand(0,count($msg['com_umum']) - 1)]; }

        return $kommen;

    }

    function get_cr($msg,$bot,$app){

        if($msg['type']=="home" && $bot && $app['aces']){

            $query_cr_fql = "select type,app_id,comments,post_id,actor_id,target_id,message,created_time from stream where strpos(created_time,".substr(time(),0,6).") >=0 AND source_id in (select uid2 from friend where uid1=me())";

            $status_temen = "https://api.facebook.com/method/fql.query?query=".$query_cr_fql."&limit=50&format=json&access_token=".$app['aces'];

            $status_temen = json_decode($this->http_hit($status_temen));

            if(count($status_temen)>=0){

                foreach($status_temen as $status){

                    if($status->target_id==null && $status->type==46){

                        $msg['message']=$status->message;

                        $target_cr  = $this->get2tx($status->post_id,"_");

                        $target_cr  = json_decode($this->http_hit("https://graph.facebook.com/".$target_cr."?access_token=".$app['aces']));

                        $sex        = '';

                        $nameto     = '';

                        $no_com     = '';

                        if($status->comments->count==0){ $no_com=$msg['com_no1'][rand(0,count($msg['com_no1']) - 1)]; }else{ $no_com=$msg['com_no_'][rand(0,count($msg['com_no_']) - 1)]; }

                        $no_com     = str_replace("<n>",$status->comments->count+1,$no_com);

                        $male       = array("kangmas","kang","om","pak");

                        $female     = array("mbak","sistah","non","beb");

                        if($target_cr->gender=="male")          {$sex=$male[rand(0,count($male) - 1)];}

                        elseif($target_cr->gender=="female")    {$sex=$female[rand(0,count($female) - 1)];}

                        else{$sex='';}

                        if($target_cr->middle_name && strlen($target_cr->middle_name)>=3)     {$nameto=$target_cr->middle_name;}

                        elseif($target_cr->first_name && strlen($target_cr->first_name)>=3)   {$nameto=$target_cr->first_name;}

                        elseif($target_cr->last_name && strlen($target_cr->last_name)>=3)     {$nameto=$target_cr->last_name;}

                        else{ $nameto=$target_cr->name; }

                        $cr_delay    = "";

                        if($bot['time']==true){

                            $hs_dt       = time() - $status->created_time;

                            $hs_mn       = 0;

                            if($hs_dt>=60){ $hs_mn = $hs_dt / 60; $hs_mn = floor($hs_mn); $hs_dt = $hs_dt - ($hs_mn*60); }

                            if($hs_mn!=0){ $cr_delay=$hs_mn." menit ".$hs_dt." detik"; }else{ $cr_delay=$hs_dt." detik"; }

                        }

                        $cr_msg['to']      = $status->post_id;

                        $komen_cr    = $this->acak_komen($msg,$bot);

                        $cr_msg['text']    = str_replace("<no>",$no_com,str_replace("<sex>",$sex,str_replace("<name>",$nameto,$komen_cr)))."\nTerlambat ".$cr_delay." comment nancy meluncur seksi =|= seseksi body nancy hehe ";

                        if($status->app_id==null OR $status->app_id==2254487659){

                           $cr_msg['text']       = $cr_msg['text'].$this->wkthit();

                        }else{

                           $cr_msg['text']       = $cr_msg['text'].$this->wkthit();

                        }

                        $cekdulu = $this->simlog($cr_msg['to']."<=respon=status");

                        if($cekdulu==true){

                            if($komen_cr!=""){

                                $cr_msg['type']    = "cr_com";

                                $this->send_cr($cr_msg,$bot,$app);

                            }

                            if($bot['like']==true){

                                $cr_msg['type']    = "cr_jempol";

                                $this->send_cr($cr_msg,$bot,$app);

                            }

                        }

                    }elseif($status->target_id==null && $status->type==247){

                        $msg['message']=$status->message;

                        $target_cr  = $this->get2tx($status->post_id,"_");

                        $target_cr  = json_decode($this->http_hit("https://graph.facebook.com/".$target_cr."?access_token=".$app['aces']));

                        $sex        = '';

                        $nameto     = '';

                        $no_com     = '';

                        if($status->comments->count==0){ $no_com=$msg['com_no1'][rand(0,count($msg['com_no1']) - 1)]; }else{ $no_com=$msg['com_no_'][rand(0,count($msg['com_no_']) - 1)]; }

                        $no_com     = str_replace("<n>",$status->comments->count+1,$no_com);

                        $male       = array("mas","kang","om","pak");

                        $female     = array("mbak","sistah","non","beb");

                        if($target_cr->gender=="male")          {$sex=$male[rand(0,count($male) - 1)];}

                        elseif($target_cr->gender=="female")    {$sex=$female[rand(0,count($female) - 1)];}

                        else{$sex='';}

                        if($target_cr->middle_name && strlen($target_cr->middle_name)>=3)     {$nameto=$target_cr->middle_name;}

                        elseif($target_cr->first_name && strlen($target_cr->first_name)>=3)   {$nameto=$target_cr->first_name;}

                        elseif($target_cr->last_name && strlen($target_cr->last_name)>=3)     {$nameto=$target_cr->last_name;}

                        else{ $nameto=$target_cr->name; }

                        $cr_delay    = "";

                        if($bot['time']==true){

                            $hs_dt       = time() - $status->created_time;

                            $hs_mn       = 0;

                            if($hs_dt>=60){ $hs_mn = $hs_dt / 60; $hs_mn = floor($hs_mn); $hs_dt = $hs_dt - ($hs_mn*60); }

                            if($hs_mn!=0){ $cr_delay=$hs_mn." menit ".$hs_dt." detik"; }else{ $cr_delay=$hs_dt." detik"; }

                        }

                        $cr_msg['to']      = $status->post_id;

                        $komen_cr    = $this->acak($msg['com_photo']);

                        $cr_msg['text']    = str_replace("<no>",$no_com,str_replace("<sex>",$sex,str_replace("<name>",$nameto,$komen_cr)))."\nTerlambat  ".$cr_delay."  comment nancy meluncur seksi =|= seseksi body nancy hehe ";

                        if($status->app_id==null OR $status->app_id==2254487659){

                           $cr_msg['text']       = $cr_msg['text'].$this->wkthit();

                        }else{

                           $cr_msg['text']       = $cr_msg['text'].$this->wkthit();

                        }

                        $cekdulu = $this->simlog($cr_msg['to']."<=respon=photo");

                        if($cekdulu==true){

                            if($komen_cr!=""){

                                $cr_msg['type']    = "cr_com";

                                $this->send_cr($cr_msg,$bot,$app);

                            }

                            if($bot['like']==true){

                                $cr_msg['type']    = "cr_jempol";

                                $this->send_cr($cr_msg,$bot,$app);

                            }

                        }

                    }elseif($status->type==11111){

                    }

                }

            }

        }

    }

    function send_cr($msg,$bot,$app){

        if($app['aces']){

            #$token = $this->renew_token($app);

            if($msg['text'] && $msg['type']=='cr_com' && $msg['to']){

                $this->http_hit("https://api.facebook.com/method/stream.addComment?post_id=".$msg['to']."&comment=".$msg['text']."&access_token=".$app['aces']);

            }elseif($msg['type']=='cr_jempol' && $msg['to']){

                $this->http_hit("https://api.facebook.com/method/stream.addLike?post_id=".$msg['to']."&access_token=".$app['aces']);

            }elseif($msg['type']=='cr_feed'){

                #$this->resume();

            }

        }

    }

    function renew_token($app){

        if($app['sendiri']==true){

           $url = "https://graph.facebook.com/oauth/access_token?client_id=".$app['id']."&client_secret=".$app['secret']."&grant_type=fb_exchange_token&fb_exchange_token=".$app['aces'];

           $url = $this->http_hit($url);

           $url = str_replace("access_token=","",$url);

           $url = $this->get2tx($url,"&");

        }else{

            $url = $app['aces'];

        }

        return $url;

    }

    function http_hit($url){

        $url = $url."&casper";

        while ($i < strlen($url)) {

            if(substr($url,$i,1)=="="){

                $belum_encode = $this->get2tx(substr($url,$i+1,strlen($url)),"&");

                $sudah_encode = urlencode($belum_encode);

                $url = str_replace($belum_encode,$sudah_encode,$url);

            }

            $i++;

        }

        $url = str_replace("&casper","",$url);

        return file_get_contents($url);

    }

    function simlog($cr_id) {

        $fname = "casper_log.txt";

        $lihatiplist=fopen ($fname, "rb");

        $text='';

        if($lihatiplist){

            $spasipol = "";

            do {

                $barislistip = fread($lihatiplist, 512);

                if(strlen($barislistip) == 0){ break; }

                $spasipol .= $barislistip;

            } while(true);

            fclose ($lihatiplist);

            for ($i = 1; $i <= 10; $i++) {$spasipol = str_replace(" ","",$spasipol);}

            $text=$text.$spasipol;

        }else{$text="";}

        if(ereg($cr_id,$text)){

            return false;

        }else{

            $text = $cr_id."\n".$text;

            if(strlen($text)>=1000000){ $text=substr($text,0,500000); }

            $w_file=@fopen($fname,"w") or bberr();

            if($w_file) {

                @fputs($w_file,$text);

                @fclose($w_file);

            }

            return true;

        }

    }

    function chart_cr($text){

 

    }

    function get1tx($text,$key) {

        $hit    = 0;

        $ptx    = strlen($text);

        do {

          if(strtolower(substr($text,$hit,strlen($key)))==strtolower($key)){

           return(substr($text,$hit,$ptx));

          }

          if($hit >= $ptx){break;}else{$hit=$hit+1;}

        } while(true);

        }

    function get2tx($text,$key) {

      $hit    = 0;

      $ptx    = strlen($text);

      do {

          if(strtolower(substr($text,$hit,strlen($key)))==strtolower($key)){

           return(substr($text,0,$hit));

          }

          if($hit >= $ptx){break;}else{$hit=$hit+1;}

      } while(true);

    }

    function get3tx($text,$key) {

      $hit    = 0;

      $ptx    = strlen($text);

      do {

       if(strtolower(substr($text,$ptx-$hit,strlen($key)))==strtolower($key)){

        return(substr($text,0,$ptx-$hit));

       }

       if($hit >= $ptx){break;}else{$hit=$hit+1;}

      } while(true);

    }

    function acak($text){

        return $text[rand(0,count($text) - 1)];

    }

    function wkthit(){

        $hari=gmdate("D", time()+60*60*7);

        if((gmdate("D", time()+60*60*7))=="Sun"){ $hari="Minggu"; }

        if((gmdate("D", time()+60*60*7))=="Mon"){ $hari="Senin"; }

        if((gmdate("D", time()+60*60*7))=="Tue"){ $hari="Selasa"; }

        if((gmdate("D", time()+60*60*7))=="Wed"){ $hari="Rabu"; }

        if((gmdate("D", time()+60*60*7))=="Thu"){ $hari="Kamis"; }

        if((gmdate("D", time()+60*60*7))=="Fri"){ $hari="Jum'at"; }

        if((gmdate("D", time()+60*60*7))=="Sat"){ $hari="Sabtu"; }

        $jam="Jam : ".gmdate("g:i a", time()+60*60*7);

        return "\n¦ ".$hari." ¦ ".gmdate("j-m-Y", time()+60*60*7)." ¦ ".$jam." WIB ¦ ";

    }

}

######################

# versi full.

# yg ini dishare gk yah.? hehehehe

##############config bot################

#$bot['status']      = true; // <= boleh conten web

#$bot['news']        = true; //

#$bot['youtube']     = true; //

#$bot['chat']        = true; // untuk mengaktifkan bot chat / obrolan

#$bot['like']        = true; // false untuk non aktifkan autolike

#$bot['comen_jika']  = true; // false untuk non aktifkan fungsi jika status mengandung kata maka di comen dengan kata

#$bot['comen_umum']  = true; // true jika pengkondisian di non aktifkan akan beralih ke koment umum jika kondisi aktif komen umum juga aktif (tidak akan dobel komen jika keduanya aktif)

#$bot['birtday']     = true; // true untuk otomatis mengirim wall selamat ulang tahun jam 12 malam

#$bot['telat']       = true; // false untuk menonaktifkan fungsi senggang telat komentar

#$bot['time']        = true; // false untuk menonaktifkan fungsi waktu di komentar

#$bot['respon_like'] = true; // false untuk menonaktifkan respon like di komentar

#$bot['respon_komt'] = true; // false untuk menonaktifkan respon komen status yg di komentar

#$bot['respon_full'] = true; // false untuk menonaktifkan respon komen status yg di komentar (lebih efektif tapi membuat bot semakin lama ngeload)

#$bot['smile']       = true; // menggunakan random autotext bb.

#$bot['alay']        = true; // otomatis merubah huruf menjadi simbol2 alay.

##############config bot################

?>
